
export default function(func, observableObj) {
  return async function() {
    try {
      observableObj.loading = true;
      var ret = await func.apply(this, arguments);
      observableObj.loading = false;
      return ret;
    } catch (e) {
      observableObj.loading = false;
      throw e;
    }
  };
}
